package entitys;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;

/**
 *
 * @author Amauri
 */
@Entity
public class Campeonato implements Serializable {
    
    @SequenceGenerator(
            allocationSize = 1, 
            schema = "myschema",  
            name = "CD_CAMPEONATO_GENERATOR", 
            sequenceName = "PESSOA_SEQ"
    )
    @Id
    @GeneratedValue(
            strategy = GenerationType.SEQUENCE, 
            generator = "CD_CAMPEONATO_GENERATOR"
    )
    private Long ID;

    @OneToMany(fetch = FetchType.EAGER)
    private List<Time> times;
    
    private String nome;
    private Boolean isAtivo;

    public Long getID() {
        return ID;
    }

    public void setID(Long ID) {
        this.ID = ID;
    }
    
    public List<Time> getTimes() {
        return times;
    }

    public void setTimes(List<Time> times) {
        this.times = times;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public Boolean getIsAtivo() {
        return isAtivo;
    }

    public void setIsAtivo(Boolean isAtivo) {
        this.isAtivo = isAtivo;
    }
}